import cv2
import numpy as np
from matplotlib import pyplot as plt

img1 = cv2.imread(r"C:\Users\Public\opencv\Figure\lena.png")

rows,cols = img1.shape[0:2]

# 旋转60度
M = cv2.getRotationMatrix2D((cols/2,rows/2), 60, 1)
img2 = cv2.warpAffine(img1, M, (cols,rows))

# 剪切
img3 = img1[10:130, 30:110]

plt.subplot(131),plt.imshow(img1)
plt.subplot(132),plt.imshow(img2)
plt.subplot(133),plt.imshow(img3)

cv2.waitKey(0)
cv2.destroyAllWindows()